Beginning R 4 by Matt Wiley & Joshua F. Wiley

Beginning R 4 by Matt Wiley & Joshua F. Wiley

Author:Matt Wiley & Joshua F. Wiley
Language: eng
Format: epub
ISBN: 9781484260531
Publisher: Apress


You may recall, from Chapter 1, a similar plot using mpg and wt. This time, we use the ggplot() function you now know. As you might suspect, we need to learn a bit more about graph building! Because you are now comparing two dimensions of data, the mapping needs to include both an x variable and a y variable. As always, that is set in the aesthetic area.

Additionally, you need a new visual geometry – in this case geom_point() – to provide a point plot of each (x, y) coordinate point in the data set:ggplot(data = mtcarsData,

mapping = aes(x = mpg,

y = hp)) +

geom_point()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.